data segment
	num db 5,4,3,8,5,6,7,8,9,7
	string1 db "Min:$"
	string2 db "Max:$"
data ends

code segment
main proc far
	assume cs:code,ds:data,es:data

start:
	push  ds
	sub ax,ax
	push ax
	mov ax,data
	mov ds,ax
	mov es,ax
	
	mov cx,10
	lea di,num
	mov al,[num];max
	mov bl,[num];min
next:	
	mov dl,[di]
	cmp dl,al
	jnl p1
	mov al,[di]
p1:
	mov dl,[di]
	cmp dl,bl
	jng p2
	mov bl,[di]
p2:
	inc di
	loopnz next
	add al,30h
	add bl,30h
	lea dx,string2
	mov ah,09h
	int 21h
	mov dl,bl
	mov ah,02h
	int 21h
	mov dx,0dh
	mov ah,02h
	int 21h

	mov dx,0ah
	mov ah,02h
	int 21h

	lea dx,string1
	mov ah,09h
	int 21h
	mov dl,al
	mov ah,02h
	int 21h
	mov dx,0dh
	mov ah,02h
	int 21h
	ret
main endp
code ends
	end start

